#define _CRT_SECURE_NO_WARNINGS 1


class Solution
{
public:
    int countSymmetricIntegers(int low, int high)
    {
        int n = low / 2, count = 0;
        for (int i = low; i <= high; i++)
        {
            vector<int> v;
            int temp = i;
            while (temp)
            {
                v.push_back(temp % 10);
                temp /= 10;
            }
            int sum1 = 0, sum2 = 0;
            for (int j = 0; j < n; j++)
            {
                sum1 += v[j];
            }
            for (int j = n; j < v.size(); j++)
            {
                sum2 += v[j];
            }
            if (sum1 == sum2)
            {
                count++;
            }
        }
        return count;
    }
};